import type { DishItemResult, SetmealItemResult } from '@/types/meal'
import request from '@/utils/request/request'

/**
 * 获取商家菜品列表
 * @param businessId
 * @returns
 */
export const getDishListAPI = (businessId: number) => {
  return request<DishItemResult[]>({
    method: 'GET',
    url: '/dish/list',
    params: { businessId },
  })
}
/**
 * 根据id查询菜品详情
 * @param id
 * @returns
 */
export const getDishByIdAPI = (id: number) => {
  return request({
    method: 'GET',
    url: `dish/${id}`,
  })
}
/**
 * 获取商家套餐列表
 * @param businessId
 * @returns
 */
export const getSetmealListAPI = (businessId: number) => {
  return request<SetmealItemResult[]>({
    method: 'GET',
    url: '/setmeal/list',
    params: { businessId },
  })
}
/**
 * 获取套餐包含的菜品详情
 * @param id
 * @returns
 */
export const getSetmealDishAPI = (id: number) => {
  return request({
    method: 'GET',
    url: `/setmeal/dish/${id}`,
  })
}
